package io.renren.modules.lucky.dao;

import io.renren.modules.lucky.entity.AppGoodsCommentEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * app端-商品-评论信息表
 * 
 * @author chenshun
 * @email chenchen@ashacker.com
 * @date 2019-08-31 20:58:38
 */
@Mapper
public interface AppGoodsCommentDao extends BaseMapper<AppGoodsCommentEntity> {

    /**
     * 根据商品id，获取评论人信息列表
     * @param goodsId
     */
    List<Map<String, Object>> getGoodsCommentList(int goodsId);

    /**
     * 插入一条评论并且返回id
     *
     * @param goodsCommentEntity
     * @return
     */
    int insertComment(@Param("goodsCommentEntity")AppGoodsCommentEntity goodsCommentEntity);

    /**
     * 根据评论id，获取评论人信息
     * @param id
     */
    Map<String, Object> getGoodsComment(int id);

    /** 
     * 根据商品id,获取评论数量
     * @return
     */
    List<Map<String, Object>> selectCommCountByGoods(@Param("ids") List<Integer> ids);
}
